package com.yitiao.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.util.Date;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;

/**
    * 商品表
    */
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
@TableName(value = "t_commerce_goods")
public class CommerceGoods {
    /**
     * 自增主键
     */
    @TableId(value = "id", type = IdType.INPUT)
    private Long id;

    /**
     * 商品类别
     */
    @TableField(value = "goods_category")
    private String goodsCategory;

    /**
     * 品牌分类
     */
    @TableField(value = "brand_category")
    private String brandCategory;

    /**
     * 商品名称
     */
    @TableField(value = "goods_name")
    private String goodsName;

    /**
     * 商品图片
     */
    @TableField(value = "goods_pic")
    private String goodsPic;

    /**
     * 商品描述信息
     */
    @TableField(value = "goods_description")
    private String goodsDescription;

    /**
     * 商品状态
     */
    @TableField(value = "goods_status")
    private Integer goodsStatus;

    /**
     * 商品价格
     */
    @TableField(value = "price")
    private Integer price;

    /**
     * 总供应量
     */
    @TableField(value = "supply")
    private Long supply;

    /**
     * 库存
     */
    @TableField(value = "inventory")
    private volatile Long inventory;
//    private volatile Long inventory = 5000L;

    /**
     * 商品属性
     */
    @TableField(value = "goods_property")
    private String goodsProperty;

    /**
     * 创建时间
     */
    @TableField(value = "create_time")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;

    /**
     * 更新时间
     */
    @TableField(value = "update_time")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date updateTime;
}